<?php

class IndexAction extends CommonAction {

    public function index() {

        import('ORG.Util.Image');

        //$content = Image::buildImageVerify();
        $this->assign('content', $content);
        $this->display();
    }

    public function image($image) {
        $map = explode(',', $image);
        $name = join('.', array_slice($map, 0, 2));
        $path = "./Public/Images/" . $name;
        import('ORG.Util.Image');
        $info = Image::getImageInfo($path);
        $width = $map[2]? : $info['width'];
        $height = $map[3]? : $info['height'];
        $im = Image::thumb($path, '', '', $width, $height);
        Image::output($im);
    }

    public function verify() {
        import('ORG.Util.Image');
        Image::buildImageVerify();
    }

}
